/*
 * This file is part of Euphrat.
 *
 * Copyright © 2012 Bart Verhoeven
 *
 * Euphrat is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Euphrat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Euphrat. If not, see <http://www.gnu.org/licenses/>.
 */
package org.euphrat.client.service.login;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * <p>Asynchronous wrapper around the {@link LoginService}. Use this class
 * to query the login service.</p>
 *
 * <p>Example usage: <pre>{@code
 *    AsyncCallback<LoginContext> callback = new AsyncCallback<LoginContext>() {
 *       public void onFailure(Throwable caught) {
 *          // do something
 *       }
 *       public void onSuccess(LoginContext context) {
 *          // do something
 *       }
 *    };
 *    String requestURL = GWT.getHostPageBasURL();
 *    LoginServiceAsync service = GWT.create(LoginService.class);
 *    LoginContext context = service.requestLogin(requestURL, callback);
 * }</pre></p>
 *
 * @author Bart Verhoeven
 */
public interface LoginServiceAsync {

  /**
   * Asynchronous wrapper around {@link LoginService#requestLogin}.
   *
   * @param requestUri the URI from which this request originates
   * @param asyncCallback callback notified when execution has finished
   * @see LoginService#requestLogin(String)
   */
  void requestLogin(String requestUri, AsyncCallback<LoginContext> asyncCallback);

}
